import Vue from 'vue'
import VueRouter from 'vue-router'
// import Home from '../views/Home.vue'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    redirect: '/login'
  },
  {
    path: '/login',
    name: 'login',
    component: () => import('../views/login.vue')
  },
  {
    path: '/home', // 管理端
    component: () => import('../views/Home.vue'),
    children: [
      { //
        path: '', // 二级路由的path 什么都不写 代表二级路由的默认组件 如果 a => /home/a 如果什么都不写  /home
        component: () => import('../views/LordHome') // 默认的二级路由组件
      },
      {
        path: 'Institutional', // 机构管理
        component: () => import('../views/Institutional')
      },
      {
        path: 'Teacher', // 教师管理
        component: () => import('../views/Teacher')
      },
      {
        path: 'Teaching', // 教学点管理
        component: () => import('../views/Teaching')
      },
      {
        path: 'Course', // 课程管理
        component: () => import('../views/Course')
      },
      {
        path: 'materials', // 教材管理
        component: () => import('../views/materials')
      },
      {
        path: 'Monitoring', // 视频监控
        component: () => import('../views/Monitoring')
      },
      {
        path: 'Finance', // 财务人员管理
        component: () => import('../views/Finance')
      },
      {
        path: 'FiledunderInfo', // 建档信息管理
        component: () => import('../views/FiledunderInfo')
      },
      {
        path: 'Contract', // 合同管理
        component: () => import('../views/Contract')
      },
      {
        path: 'Order', // 订单管理
        component: () => import('../views/Order')
      },
      {
        path: 'EarlyWarning', // 预警信息
        component: () => import('../views/EarlyWarning')
      },
      {
        path: 'Funds', // 资金预警
        component: () => import('../views/Funds')
      },
      {
        path: 'Credit', // 信用预警
        component: () => import('../views/Credit')
      },
      {
        path: 'Account', // 账户监管
        component: () => import('../views/Account')
      },
      {
        path: 'AgencyAccount', // 机构账户管理
        component: () => import('../views/AgencyAccount')
      },
      {
        path: 'SystemConfiguration', // 系统配置
        component: () => import('../views/SystemConfiguration')
      },
      {
        path: 'ExceptionMsg', // 异常数据
        component: () => import('../views/ExceptionMsg')
      },
      {
        path: 'UserManagement', // 用户管理
        component: () => import('../views/UserManagement')
      },
      {
        path: 'agencyDetails', // 机构详情弹窗
        component: () => import('@/views/Institutional/agencyDetails')
      },
      {
        path: 'organizationInfo', // 教材详情弹窗
        component: () => import('@/views/materials/organizationInfo.vue')
      },
      {
        path: 'addUser', // 教材详情弹窗
        component: () => import('@/views/UserManagement/addUser.vue')
      }
    ]
  },
  {
    path: '/organizationPort', // 机构端
    component: () => import('@/views/organizationPort'),
    children: [
      {
        path: '',
        component: () => import('@/views/organizationPort/home')
      },
      {
        path: 'declare',
        component: () => import('@/views/organizationPort/declare')
      },
      {
        path: 'Management',
        component: () => import('@/views/organizationPort/Management')
      }
    ]
  }
]

const router = new VueRouter({
  routes
})

export default router
